package cn.itcast.controller.company;

import cn.itcast.company.CompanyService;
import cn.itcast.domain.company.Company;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@Controller
@RequestMapping("/company")
public class CompanyController {


    @Autowired
    private CompanyService companyService;


    @RequestMapping("/companyList")
    public String findAll(HttpServletRequest request){

        List<Company> companyList = companyService.findAll();
        request.setAttribute("companyList",companyList);

        return "company/company-list";

    }


}
